<!DOCTYPE html>
<!-- saved from url=(0079)https://www.17sucai.com/preview/2/2016-07-26/jQuery-VerificationCode/index.html -->
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>后台登录</title>
    <meta name="author" content="DeathGhost">
    <link rel="stylesheet" type="text/css" href="./style.css" tppabs="css/style.css">
    <style>
        body {
            height: 100%;
            background: #16a085;
            overflow: hidden;
        }

        canvas {
            z-index: -1;
            position: absolute;
        }

        .admin_login dd .submit_btn1 {
            width: 100%;
            height: 42px;
            border: none;
            font-size: 16px;
            background: #048f74;
            color: #f8f8f8;
        }
    </style>
    <script src="../../jquery-3.5.1.min.js"></script>
    <script src="./verificationNumbers.js" tppabs="js/verificationNumbers.js"></script>
    <script src="./Particleground.js" tppabs="js/Particleground.js"></script>
    <script src="../../js/md5.js"></script>
    <script src="../../layui.all.js?t=1615823099769"></script>
    <script>


        $(document).ready(function () {
            //粒子背景特效
            $('body').particleground({
                dotColor: '#5cbdaa',
                lineColor: '#5cbdaa'
            });
            //验证码
            // createCode();
            //测试提交，对接程序删除即可
            $("#loginSumbit").click(function () {

                // if (validate()) {
                if (true) {
                    var username = document.getElementById("username").value
                    var password = md5(document.getElementById("password").value)
                    $.ajax({
                        type: 'POST',
                        url: '/login',//发送请求
                        data: {username: username, password: password},
                        dataType: "json",
                        success: function (result) {
                            var htmlCont = result;//返回的结果页面

                            if (result.code == 0) {
                                location.href = "../../list.html";

                            } else {
                                layui.use('layer', function () {
                                    var layer = layui.layer;
                                    layer.msg('账号密码错误', {icon: 5, offset: 't'});
                                });

                            }
                        }
                    });
                }
            });
        });
    </script>
</head>
<body>
<canvas class="pg-canvas" width="1680" height="477"></canvas>
<dl class="admin_login">
    <dt>
        <strong>韭菜系统</strong>
        <em>Management System</em>
    </dt>
    <dd class="user_icon">
        <input id="username" type="text" placeholder="账号" class="login_txtbx">
    </dd>
    <dd class="pwd_icon">
        <input id="password" type="password" placeholder="密码" class="login_txtbx">
    </dd>
    <!--    <dd class="val_icon">-->
    <!--&lt;!&ndash;        <div class="checkcode">&ndash;&gt;-->
    <!--&lt;!&ndash;            <input type="text" id="J_codetext" placeholder="验证码" maxlength="4" class="login_txtbx">&ndash;&gt;-->
    <!--&lt;!&ndash;            <canvas class="J_codeimg" id="myCanvas" onclick="createCode()">做最纯粹的韭菜!</canvas>&ndash;&gt;-->
    <!--&lt;!&ndash;        </div>&ndash;&gt;-->
    <!--&lt;!&ndash;        <input type="button" value="验证码核验" class="ver_btn" onclick="validate();">&ndash;&gt;-->
    <!--        <input type="button" value="想用就注册" class="ver_btn" onclick="registered();">-->
    <!--    </dd>-->
    <dd>
        <input type="button" value="马上注册" class="submit_btn1" onclick="registered();">
    </dd>
    <dd>
        <input type="button" value="立即登陆" class="submit_btn" id="loginSumbit">
    </dd>
    <dd>
        <p>© zk版权所有</p>
        <p></p>
    </dd>
</dl>

<script>
    //注册用户
    function registered() {
        layui.use('layer', function () {
            var layer = layui.layer;
            layer.open({
                type: 2,
                content: '../../createUser.html',
                area: ['600px', '300px'],
                title: '注册用户'
            });
        });


    }
</script>
</body>
</html>